package commercial.src;
public class Product {
    private int serialNumber;
    private String name;
    private double price; // 使用 double 表示价格
    private int stock;
    private String size;

    public Product(int serialNumber, String name, double price, int stock, String size) {
        this.serialNumber = serialNumber;
        this.name = name;
        this.price = price;
        this.stock = stock;
        this.size = size;
    }

    // Getter 和 Setter 同理，只改了拼写
    public int getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(int serialNumber) {
        this.serialNumber = serialNumber;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getStock() {
        return stock;
    }

    public void setStock(int stock) {
        this.stock = stock;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    public void displayInfo() {
        System.out.println("序列号 " + serialNumber + " 商品名: " + name +
                "，价格: " + price + "，库存: " + stock + "，尺寸: " + size);
    }
}
